<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .for{
            width: 400px;
            height: 400px;
            border: 2px solid;
            transform-style: preserve-3d;
            transition: all 2s ease;
            margin: 80px auto;
            position: relative;

        }
        .one{
            width: 400px;
            height: 400px;
            background-color: burlywood;
            color: white;
            font-size: 200px;
            text-align: center;
            line-height: 400px;
            transform: translateZ(100px);
        }
        .two{
            width: 400px;
            height: 400px;
            background-color: rgb(43, 180, 130);
            color: white;
            font-size: 200px;
            margin: 0px auto;
            position: absolute;
            top:0px;
            left:0px;
            transform: translateZ(100px);
            text-align: center;
            line-height: 400px;
            transform: rotateX(90deg);
        }
        div:hover.for{
            transform: rotateX(-90deg);
            transform-origin:-300px -400px -500px ;

        }
        div:visited{
            transform: rotateX(-90deg);
            transition: all 2s ease;
            transform-style: preserve-3d;
            transform-origin:-300px -400px -500px ;

        }
    </style>
</head>
<body>
    <div class="for">
    <div class="one"><img src="imag/OIP-C (3).jfif"width="400px" height="400px" alt=""></div>
    <div class="two"><img src="imag/OIP-C (4).jfif"width="400px" height="400px"></div>
    </div>
</body>
</html>